<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <button>按钮1</button>
    <script>
        var w=new Worker("1.js");
        w.onmessage=function (e) {
          console.log(e.data);
          result.innerHTML=e.data;

        }
        w.postMessage("计算数值");
    </script>
    <button>按钮2</button>
<div id="result"></div>
</body>
</html>